const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin.js')
const HtmlWebpackPlugin = require( 'html-webpack-plugin' )
module.exports = {
    mode:'none',
    entry:'./src/main.js',
    output:{
        filename:'bundle.js',
        path:path.join(__dirname,'dist')
    },
    module:{
        rules:[
            {
                test: /\.(vue|js)$/,
                loader: "eslint-loader",
                // 预处理
                exclude: /node_modules/,
                enforce: "pre"
            },
            {
                test:/\.vue$/,
                use:'vue-loader'
            },
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader',
                   
                }
            },
            {
                test:/\.png$/,
                use: {
                    loader: 'url-loader',
                    options: {
                        limit: 12 * 1024 ,// 12 KB,
                         esModule: false
                    }
                }
            },
            {
                test: /\.less$/,
                use: ['vue-style-loader', 'css-loader','less-loader']
            },
            {
                test: /\.css$/,
                use: ['vue-style-loader', 'css-loader']
            },
           
        ]
    },
    plugins:[
        new VueLoaderPlugin(),
         new HtmlWebpackPlugin( {
             title: 'Vue Webpack Sample',
             meta: {
                 viewport: 'width=device-width'
             },
             template: './public/index.html' //模版文件地址
         } ),
    ]

}